﻿
public abstract class UserTest
{
   
    public abstract void M1();
    public abstract void M2();
    public abstract void M3();
}

public class UserTestImpl : UserTest
{
    public override void M1()
    {
        Console.WriteLine("子类实现M1方法");
    }

    public override void M2()
    {
        Console.WriteLine("子类实现M2方法");
    }

    public override void M3()
    {
        Console.WriteLine("子类实现M3方法");
    }
}


/*public interface IUserService  
{
    void Add();    
    void Delete(); 
    void Update(); 
    void Query(); 
}

    UserServiceImpl
public class UserServiceImpl : IUserService
{
    public void Add()
    {
        Console.WriteLine("执行增加操作");
    }

    public void Delete()
    {
        Console.WriteLine("执行删除操作");
    }

    public void Update()
    {
        Console.WriteLine("执行修改操作");
    }

    public void Query()
    {
        Console.WriteLine("执行查询操作");
    }
}


public class Student
{
    private string name;
    private int age;

    public Student(string name, int age)
    {
        this.name = name;
        this.age = age;
    }

    public void Study()
    {
        Console.WriteLine($"{name}正在学习");
    }

    public string Name => name;
    public int Age => age;
}


public class Father
{
    protected string familyName;

    public Father(string familyName)
    {
        this.familyName = familyName;
        Console.WriteLine($"父亲的姓氏：{familyName}");
    }

    public void Work()
    {
        Console.WriteLine($"{familyName}家的父亲在工作");
    }
}

public class Child : Father
{
    public Child(string familyName) : base(familyName)
    {
    }

    public void Play()
    {
        Console.WriteLine($"{familyName}家的孩子在玩耍");
    }
}

public class Son : Child
{
    public Son(string familyName) : base(familyName)
    {
    }

    public void Study()
    {
        Console.WriteLine($"{familyName}家的儿子在上学");
    }
}

class Program
{
    static void Main(string[] args)
    {
        UserTest userTest = new UserTestImpl();
        userTest.M1();
        userTest.M2();
        userTest.M3();

        IUserService userService = new UserServiceImpl();
        userService.Add();
        userService.Delete();
        userService.Update();
        userService.Query();

        Student student = new Student("张三", 18);
        student.Study();

        Father father = new Father("李");
        father.Work();

        Child child = new Child("王");
        child.Play();

        Son son = new Son("赵");
        son.Work();  
        son.Play();  
        son.Study(); 

        Console.ReadLine(); 
    }
}*/
